<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCrawlerFiltersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('crawler_filters', function (Blueprint $table) {
            $table->increments('id');
            $table->string('domain')->comment('域名');
            $table->string('list_filter')->comment('列表获取规则');
            $table->string('link_filter')->comment('内容链接获取规则');
            $table->string('title_filter')->comment('标题获取规则');
            $table->string('content_filter')->nullable()->comment('内容获取规则');
            $table->string('images_filter')->comment('图片获取规则');
            $table->integer('origin_url_id')->unsigned()->comment('对应起始地址');
            $table->boolean('status')->comment('是否测试通过');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('crawler_filters');
    }
}
